package com.andnnl.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

/**
 * Created by chenss on 2023/5/30.
 */
@Aspect
public class LoggingAspect {
    @Before("execution(* com.example.*.*(..))")
    public void beforeMethodExecution(JoinPoint joinPoint) {
        System.out.println("Method " + joinPoint.getSignature().getName() + " starts");
    }

    @After("execution(* com.example.*.*(..))")
    public void afterMethodExecution(JoinPoint joinPoint) {
        System.out.println("Method " + joinPoint.getSignature().getName() + " ends");
    }
}